package com.bootdo.updateApp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.updateApp.dao.AppUpdateDao;
import com.bootdo.updateApp.domain.AppUpdate;
import com.bootdo.updateApp.service.AppUpdateService;



@Service
public class AppUpdateServiceImpl implements AppUpdateService {
	@Autowired
	private AppUpdateDao appUpdateDao;
	
	@Override
	public AppUpdate get(Integer id){
		return appUpdateDao.get(id);
	}
	
	@Override
	public List<AppUpdate> list(Map<String, Object> map){
		return appUpdateDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return appUpdateDao.count(map);
	}
	
	@Override
	public int save(AppUpdate appUpdate){
	
		if(appUpdate.getId() != null) {
			return appUpdateDao.update(appUpdate);
		}else {
			return appUpdateDao.save(appUpdate);
		}		
	
		
	}
	
	@Override
	public int update(AppUpdate appUpdate){
		return appUpdateDao.update(appUpdate);
	}
	
	@Override
	public int remove(Integer id){
		return appUpdateDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return appUpdateDao.batchRemove(ids);
	}
	
}
